updating oE get_dstring
get_dstring
include io.e namespace io public function get_dstring(integer fh, integer delim = 0)
read a delimited byte string from an opened file.
Parameters:
- fh : an integer, the handle to an open file to read from.
- delim : an integer, the delimiter that marks the end of a byte string. If omitted, a zero is assumed.
Returns:
An sequence, made of the bytes that could be read from the file.
Comments:
- If the end-of-file is found before the delimiter, the delimiter is appended to the returned string.
Example 1:
integer fn fn = open("temp", "rb") -- an existing file sequence text text = get_dstring(fn) -- Get a zero-delimited string text = get_dstring(fn, '$') -- Get a '$'-delimited string
See Also:
Not Categorized, Please Help
|